#include"shm.hpp"
#include"namedpipe.hpp"
int main()
{
    Shm shm(gpathname,gproj_id,gCreater);
    NamedPipe fifo(fifo_path,Server);
    fifo.OpenForRead();
    //r端
    char* address = (char*)shm.GetAddress();
    char buffer[128];
    while(true)
    {
        std::string test;
        fifo.ReadPipe(&test);
        strncpy(buffer,address,sizeof(buffer)-1);
        std::cout<<"server is reading: "<<buffer<<std::endl;
        sleep(1);
    }
    return 0;
}